package com.swu.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data
@Schema(description = "更新规则请求参数")
public class RuleUpdateDTO {
    
    @NotNull(message = "规则ID不能为空")
    @Schema(description = "规则ID", required = true)
    private Long id;
    
    @NotBlank(message = "规则名称不能为空")
    @Size(max = 100, message = "规则名称长度不能超过100个字符")
    @Schema(description = "规则名称", required = true)
    private String ruleName;
    
    @NotBlank(message = "规则描述不能为空")
    @Size(max = 500, message = "规则描述长度不能超过500个字符")
    @Schema(description = "规则描述", required = true)
    private String ruleDescription;
    
    @NotNull(message = "规则类型不能为空")
    @Pattern(regexp = "^[12]$", message = "规则类型只能是1或2")
    @Schema(description = "规则类型：1-条件必填检查 2-逻辑一致性检查", required = true)
    private String ruleType;
    
    @NotBlank(message = "规则内容不能为空")
    @Schema(description = "规则内容（Drools规则语言）", required = true)
    private String ruleContent;
    
    @NotNull(message = "规则状态不能为空")
    @Pattern(regexp = "^[01]$", message = "规则状态只能是0或1")
    @Schema(description = "规则状态：0-禁用 1-启用", required = true)
    private String status;
    
    @NotBlank(message = "更新人不能为空")
    @Size(max = 50, message = "更新人长度不能超过50个字符")
    @Schema(description = "更新人", required = true)
    private String updater;
} 